www.gusucode.com > 环保时代家庭财务管理系统 EPffms v4.0 > 环保时代家庭财务管理系统 EPffms v4.0\code\eptimehome\conn.asp
<!-- #include file="inc/config.asp" --> <% '**************************************************** 'Code for EptimeFFMS 'Vision : v3.0 '**************************************************** %> <% if request.Cookies("username")="" then %> <script language="javascript"> top.location.href="index.asp" </script> <% response.end end if %> <% If(databaseType=0) Then 'ACCESS数据库 set conn=server.createobject("adodb.connection") mypath=server.mappath(""&accessFilePath&"") conn.open "provider=microsoft.jet.oledb.4.0;data source=" & mypath ElseIf(databaseType=1) Then 'MSSQL SERVER数据库 Set Conn=Server.CreateObject("Adodb.Connection") StrConn = "PROVIDER=SQLOLEDB.1;Data Source="&databaseServer&";Initial Catalog="&databaseName&";Persist Security Info=True;User ID="&databaseUser&";Password="&databasePwd&";Connect Timeout=30" Conn.Open StrConn Else '数据库设置错误 Response.Write"数据库设置错误,请联系管理员!" Response.End End If 'Response.Write StrConn %>